﻿//作业1
namespace ConsoleApp2._0923;

public partial class Demo
{
    private string name;

    public void TestPrint()
    {
       Console.WriteLine("请输入一个三位数:");
       int num = Convert.ToInt32(Console.ReadLine());
       Console.WriteLine(num / 100);
       Console.WriteLine(num % 100 / 10);
       Console.WriteLine(num % 10);
       
       
       
    }
    public void TestPrint2()
    {
        int num = 2000;
        bool flag = (num%4==0&&num%100!=0)||num%400==0;
    }
   //作业2
    public void TestPrint3()
    {
        double price = 8800;
        double discount = 0;
        Console.Write("请输入出行月份(1-12) :");
        int month = int.Parse(Console.ReadLine());
        Console.Write("请选择交通方式(1-航班，2-动车) : ");
        int transport = int.Parse(Console.ReadLine());
        if (month >= 5 && month <= 10)
        {
            if (transport == 1)
            {
                discount = 0.9;
            }
            else if (transport == 2)
            {
                discount = 0.75;
            }
        }
        else
        {
            if (transport == 1)
            {
                discount = 0.6;
            }
            else if (transport == 2)
            {
                discount = 0.3;
            }
        }
        double price1 = price*discount;
        Console.WriteLine($"该旅游行程的价格为:{price1}元");
    }
    
}